/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Utils;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;

/**
 *
 * @author gustavokatel
 */
public class Web {
    
    public static void main(String args[])
    {
        System.out.println(Web.getStatus("http://deskcine.no-ip.org"));
    }
    
    public static String getStatus(String endereco)
	{
	        BufferedReader in = null;
	        StringBuilder ret = new StringBuilder("");
	        try {
	            URL url = new URL(endereco);
	            in = new BufferedReader(new InputStreamReader(url.openStream()));
	            String str;
	            while ((str = in.readLine()) != null) {
	                ret.append(str);
	            }
	        } catch (MalformedURLException ex) {
	            //
	        } catch (IOException ex) {
	            //
	        } finally {
	            if (in != null) {
	                try {
	                    in.close();
	                } catch (Exception e) {
	                }
	            }
	        }
	        return ret.toString();
	}
}
